package com.shop.controller;

import com.shop.pojo.CommonResult;
import com.shop.pojo.UserAssembly;
import com.shop.service.IUserInfoService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/userInfo")
public class UserInfoController {
    @Resource
    private IUserInfoService userInfoService;

    @GetMapping("/getUsersInfo")
    public CommonResult<UserAssembly> getUsers(
            @RequestParam(value = "query", required = false) String query,
            @RequestParam("pageNum") int pageNum,
            @RequestParam("pageSize") int pageSize
    ) {
        return userInfoService.getUsers(query, pageNum, pageSize);
    }
}
